ci: declare contents:read on Build and Test workflow#621
Closed
arpitjain099 wants to merge 1 commit into
Closed
Conversation
The lint/build/unit_tests/integration_tests jobs only checkout sources and run Go and Make targets. None of them call the GitHub API beyond the implicit checkout read. Declaring `permissions: contents: read` at workflow scope makes that explicit and matches the per-job style used by labeler.yml and vulnerability-check.yaml. Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
Collaborator
|
Thank you for the PR. Since our actions already run with read-only tokens by default, the four listed jobs already have limited permissions. We are therefore closing this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
build-and-test.yaml is the only Kraken workflow that doesn't declare a
permissions:block. labeler.yml ties its own scopes down inside the job, and vulnerability-check.yaml declarescontents: read+security-events: writeper job.This patch adds
permissions: contents: readat workflow scope. All four jobs (lint, build, unit_tests, integration_tests) only callactions/checkout,actions/setup-go, golangci-lint,go test, and Make targets, socontents: readis enough. Several third-party actions are pulled in (golangci/golangci-lint-action,docker/setup-docker-action), which is the case worth narrowing the token for.No behavioural change. The change is one block in one file.